package com.example.springcmw.rabbitmq.consumer;

import com.example.springcmw.rabbitmq.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * 消费者接口
 */
@Service
@RabbitListener(queues = {RabbitMQConfig.RABBITMQ_DEMO_DIRECT_QUEUE})
public class ConsumerService {

    @RabbitListener
    public void process(Map map) {
        System.out.println(String.format("消费者 消费了消息： %s", map.toString()));
    }
}
